
<?php
    // Include the configuration file
    include_once dirname(__FILE__).'/examples/demo/inc/wurfl_config_standard.php';

    $wurflInfo = $wurflManager->getWURFLInfo();

    if (isset($_GET['ua']) && trim($_GET['ua'])) {
        $ua = $_GET['ua'];
        $requestingDevice = $wurflManager->getDeviceForUserAgent($_GET['ua']);
    } else {
        $ua = $_SERVER['HTTP_USER_AGENT'];
        // This line detects the visiting device by looking at its HTTP Request ($_SERVER)
        $requestingDevice = $wurflManager->getDeviceForHttpRequest($_SERVER);
    }
    $data = array();
    $data['id']=$requestingDevice->id;
    $data['brand_name']=$requestingDevice->getCapability('brand_name');
    $data['model_name']=$requestingDevice->getCapability('model_name');
    $data['marketing_name']=$requestingDevice->getCapability('marketing_name');
    $data['preferred_markup']=$requestingDevice->getCapability('preferred_markup');
    $data['width']=$requestingDevice->getCapability('resolution_width'); 
    $data['height']=$requestingDevice->getCapability('resolution_height');
    echo json_encode($data);
?>
